package com.stan.script.controller;

import com.stan.script.handle.Strategy;
import com.stan.script.model.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author Junqiang Zhu
 * @date 2024-05-06 10:09
 */
@RestController
@RequestMapping("api/update")
public class HandleController {

    @Autowired
    private Strategy strategy;


    @PostMapping("soft")
    public Result soft() {
        boolean execute = strategy.execute();
        if (execute) {
            return Result.success();
        } else {
            return Result.error();
        }
    }

    @PostMapping("test")
    public Result test() {
        return Result.success("测试阿里云镜像触发器");
    }
}
